import java.awt.Color;
import java.awt.Font;
import java.io.DataOutputStream;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Random;

import ij.IJ;
import ij.ImagePlus;
import ij.gui.NewImage;
import ij.plugin.PlugIn;
import ij.process.ImageProcessor;

// On fournit deux images (meme taille), on fabrique un masque et les deux images transformees

public class cryptoDraw2 extends ImagePlus implements PlugIn{
	
	//private ImageProcessor primeIP; 
	private int X=1024,Y=768; // image size
	
	private ImagePlus maskAlpha;  
	private ImageProcessor maskAlphaIP;  

	
	private Random generator=new Random(1214); 
	
	public void run(String arg) {
		System.out.println("go");
		
		
 			ImagePlus laListe[]=new ImagePlus[4];
 			ImageProcessor lesProcs[]=new ImageProcessor[4]; 
 			for(int i=0;i<4;i++){
 			laListe[i]=IJ.openImage("C:/Users/decomite/Pictures/station/A"+i+".jpg"); 
 			lesProcs[i]=laListe[i].getProcessor(); 
 			}
 			
 	
	
	ImagePlus image1=NewImage.createRGBImage ("Image1",2*X,2*Y, 1, NewImage.FILL_WHITE);
	ImageProcessor i1=image1.getProcessor();
	int col=0; 
	int lig=0; 
	for(int i=0;i<2*X;i++){
		if(i<X)col=0; else col=2; 
		for(int j=0;j<2*Y;j++){
			if(j<Y)lig=0; else lig=1; 
			i1.putPixel(i, j, lesProcs[col+lig].getPixel(i/2,j/2)); 
			
		}// y
     }//x
	image1.show();
}
	

}